package com.lipaluma.test.db.annotations.batch;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Defines several SQL files that contains queries that will be launched before the test starts.<br/>
 * Used to populates the database in a good state for the test.
 * 
 * @author Mario
 */
@Documented
@Inherited
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface Batch {

	/**
	 * List of SQL files to launch
	 */
	String[] value() ;

	/**
	 * define parameters to be replaced in files
	 * @return
	 */
	Param[] params() default {};

	/**
	 * name of the datasource. If not defined, it will take the default DataSource.
	 * @return
	 */
	String dataSource() default "";
	
	/**
	 * Defines a list of Batches.
	 * @author Mario
	 *
	 */
	@Documented
	@Inherited
	@Target({ElementType.METHOD, ElementType.TYPE})
	@Retention(RetentionPolicy.RUNTIME)
	public @interface List {
		Batch[] value();
	}
}
